function printcell(incell)
% function printcell(incell); 
%
% Prints the cell incell onto the screen in a nice format with columns and
% such.
%
% Cleaned up by TM: 8/8/2014
%% Get Format Specification
fprintf('\n'); 

% Get size of cell to print
[m,n]=size(incell); 

% Initialize vector of columns sizes.  Then, get the number of "columns" in
% each column.  That is, how big do the columns need to be?
fmat=zeros(1,n);
for kk=1:n  
    cols=incell(:,kk);
    fmat(kk)=size(char(cols),2); 
end

% Add an extra column for neatness
fmat=fmat + ones(1,n); 

% Create Specification
stb=['%-',num2str(fmat(1)),'s']; 
for jj=1:(n-1); 
    stb=[stb,'%-',num2str(fmat(jj+1)),'s']; 
end
stb=[stb,'\n']; 

%% Print Columns
for kk=1:m; 
    fprintf(stb,incell{kk,:}); 
end; 

end
